package com.groupThree.util;

import com.groupThree.bean.User;

import javax.servlet.http.HttpSession;

/**
 * 获取录入人信息
 */
public class UserUtil {
    public static String getUserName(HttpSession session){
    return (String) session.getAttribute("adminUsername");
    }
    public static String getUserPhone(HttpSession session){
        //TODO :录入人手机号
        String sysPhone = getWxUser(session).getU_phone();
        return sysPhone;
    }


    public static String getLoginSms(HttpSession session,String userPhone){
        return (String) session.getAttribute(userPhone);

    }


    public static void setLoginSms(HttpSession session,String userPhone,String code){
        //把登录信息存在session
        session.setAttribute(userPhone,code);
    }

    public static void setWxUser(HttpSession session, User user){
        session.setAttribute("wxUser",user);
    }


    public static User getWxUser(HttpSession session){
        return (User) session.getAttribute("wxUser");
    }
}
